﻿@model JSonTest.Customers

@{
		ViewBag.Title = "Create";
		Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Create New Customer</h2>

@using (Html.BeginForm()) 
{
		@Html.AntiForgeryToken()
		
		<div class="form-horizontal">
				<hr />
				@Html.ValidationSummary(true, "", new { @class = "text-danger" })
				<div class="form-group">
						@Html.LabelFor(model => model.Firstname, htmlAttributes: new { @class = "control-label col-md-2" })
						<div class="col-md-10">
								@Html.EditorFor(model => model.Firstname, new { htmlAttributes = new { @class = "form-control" } })
								@Html.ValidationMessageFor(model => model.Firstname, "", new { @class = "text-danger" })
						</div>
				</div>

				<div class="form-group">
						@Html.LabelFor(model => model.Lastname, htmlAttributes: new { @class = "control-label col-md-2" })
						<div class="col-md-10">
								@Html.EditorFor(model => model.Lastname, new { htmlAttributes = new { @class = "form-control" } })
								@Html.ValidationMessageFor(model => model.Lastname, "", new { @class = "text-danger" })
						</div>
				</div>

				<div class="form-group">
						@Html.LabelFor(model => model.Telephone, htmlAttributes: new { @class = "control-label col-md-2" })
						<div class="col-md-10">
								@Html.EditorFor(model => model.Telephone, new { htmlAttributes = new { @class = "form-control" } })
								@Html.ValidationMessageFor(model => model.Telephone, "", new { @class = "text-danger" })
						</div>
				</div>

				<div class="form-group">
						@Html.LabelFor(model => model.Birthdate, htmlAttributes: new { @class = "control-label col-md-2" })
						<div class="col-md-10">
								@Html.EditorFor(model => model.Birthdate, new { htmlAttributes = new { @class = "form-control" } })
								@Html.ValidationMessageFor(model => model.Birthdate, "", new { @class = "text-danger" })
						</div>
				</div>

				<div class="form-group">
						@Html.LabelFor(model => model.City, htmlAttributes: new { @class = "control-label col-md-2" })
						<div class="col-md-10">
								@Html.EditorFor(model => model.City, new { htmlAttributes = new { @class = "form-control" } })
								@Html.ValidationMessageFor(model => model.City, "", new { @class = "text-danger" })
						</div>
				</div>

				<div class="form-group">
						<div class="col-md-offset-2 col-md-10">
							@*<input type="submit" value="Create" class="btn btn-default"/>*@
							<button type="submit" value="Create" class="btn btn-success"><span class="glyphicon glyphicon-save">&nbsp;</span>Create</button>
						</div>
				</div>
		</div>
}

<div>
		@*@Html.ActionLink("Back to List", "Index", "Home")*@
		<a href="@Url.Action("Index", "Home")" class="btn btn-primary"><span class="glyphicon glyphicon-arrow-left">&nbsp;</span>Back to List</a>
</div>
